<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li {
            width: 300px;
            height: 50px;
            border: 1px solid #ffffff;
        }
    </style>
</head>

<body>
    <ul>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
    </ul>
    <script>
        var ol = document.querySelector('ul');
        ol.onclick = function(e) {
            console.log(e.target);
            e.target.style.background = 'black';
        }
    </script>
</body>

</html>